﻿// Decompiled with JetBrains decompiler
// Type: UnityEngine.Events.UnityEventTools
// Assembly: UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
// MVID: E6AE6B5A-2752-4B07-9528-C8B77C62CE79
// Assembly location: C:\Users\windys\Unity\2021.3.39f1c1\Editor\Data\Managed\UnityEngine\UnityEngine.CoreModule.dll
// XML documentation location: C:\Users\windys\Unity\2021.3.39f1c1\Editor\Data\Managed\UnityEngine\UnityEngine.CoreModule.xml

using System;

#nullable disable
namespace UnityEngine.Events
{
  internal class UnityEventTools
  {
    internal static string TidyAssemblyTypeName(string assemblyTypeName)
    {
      if (string.IsNullOrEmpty(assemblyTypeName))
        return assemblyTypeName;
      int num = int.MaxValue;
      int val1_1 = assemblyTypeName.IndexOf(", Version=");
      if (val1_1 != -1)
        num = Math.Min(val1_1, num);
      int val1_2 = assemblyTypeName.IndexOf(", Culture=");
      if (val1_2 != -1)
        num = Math.Min(val1_2, num);
      int val1_3 = assemblyTypeName.IndexOf(", PublicKeyToken=");
      if (val1_3 != -1)
        num = Math.Min(val1_3, num);
      if (num != int.MaxValue)
        assemblyTypeName = assemblyTypeName.Substring(0, num);
      int length = assemblyTypeName.IndexOf(", UnityEngine.");
      if (length != -1 && assemblyTypeName.EndsWith("Module"))
        assemblyTypeName = assemblyTypeName.Substring(0, length) + ", UnityEngine";
      return assemblyTypeName;
    }
  }
}
